package com.evan.webadmin.biz.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.evan.webadmin.biz.dao.ChallengeModuleMapper;
import com.evan.webadmin.biz.model.ChallengeModule;
import com.evan.webadmin.biz.service.IChallengeModuleService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 闯关模块表 服务实现类
 * </p>
 *
 * @author Pavel
 * @since 2025-03-06
 */
@Service
public class ChallengeModuleServiceImpl extends ServiceImpl<ChallengeModuleMapper, ChallengeModule> implements IChallengeModuleService {

    @Override
    public List<ChallengeModule> findByFront() {
        QueryWrapper<ChallengeModule> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("show_able", true);
        queryWrapper.orderByAsc("sort_num");
        queryWrapper.last("LIMIT 8");
        return list(queryWrapper);
    }
}
